﻿@model TamoCRM.Web.Mvc.Areas.Admin.Models.Contacts.ContactCreateModel

@{
    ViewBag.Title = "Contact trùng cho Importer";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
        try {
            ace.settings.check('breadcrumbs', 'fixed');
        }
        catch (e) {

        }
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="/Home">Trang chủ</a>
        </li>

        <li>
            <a href="javascript:void(0);">Danh mục</a>
        </li>
        <li class="active">Contact</li>
    </ul>
</div>

<div class="page-content">
    <div class="page-header">
        <h1>Contact trùng cho Importer</h1>
    </div>
    <!-- /.page-header -->

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            @using (Ajax.BeginForm("FilterContactDuplicateImport", "Contact", new AjaxOptions { HttpMethod = "POST" }, new { enctype = "multipart/form-data", @class = "form-horizontal", role = "form", id = "filter_contact_duplicate_import" }))
            {
                @Html.AntiForgeryToken()
                <div class="form-group">
                    <div class="col-sm-12" id="alert">
                    </div>
                </div>
            }

            <div class="space-6"></div>
            <table id="grid-table"></table>
            <div id="grid-pager"></div>

            <!-- PAGE CONTENT ENDS -->
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</div>

<script type="text/javascript">
    var url = 'admin/api/contact/filterduplicate?statusIds={0}&branchId={1}';
    var grid_selector = "#grid-table";
    var heades = ['Id', 'Họ và tên', 'SĐT', 'Email', 'Kênh', 'Level', 'Loại', 'Trạng thái', 'Trạng thái gọi', 'Ngày Import', 'TVTS', 'Thông tin trùng'];
    var model = [
        { name: 'Id', index: 'Id', editable: false, sorttype: 'string', editoptions: { disabled: true }, width: '0px' },
        { name: 'Fullname', index: 'Fullname', editable: false, sorttype: 'string' },
        { name: 'Mobile', index: 'Mobile', editable: false, sorttype: 'string' },
        { name: 'Email', index: 'Email', editable: false, sorttype: 'string' },
        { name: 'ChannelId', index: 'ChannelId', editable: false, formatter: channelFomatter },
        { name: 'LevelId', index: 'LevelId', editable: false, sorttype: 'string', formatter: levelFomatter },
        { name: 'TypeId', index: 'TypeId', editable: false, sorttype: 'string', formatter: sourceTypeFomatter },
        { name: 'StatusId', index: 'StatusId', editable: false, sorttype: 'string', formatter: statusFomatter },
        { name: 'StatusMapId', index: 'StatusMapId', editable: false, formatter: statusMapFomatter },
        { name: 'ImportedDate', index: 'ImportedDate', editable: false, formatter: 'date', formatoptions: { newformat: 'd/m/Y' } },
        { name: 'UserId', index: 'UserId', editable: false, formatter: userFomatter },
        { name: 'DuplicateInfo', index: 'DuplicateInfo', editable: false }
    ];
    $(document).ready(function () {
        var statusIds = '2,3,4,5,6,7,8,9,10';
        var branchId = '@ViewBag.BranchId';
        setupGridWithoutEdit("#grid-table",
            "#grid-pager",
            url.format(statusIds, branchId),
            "admin/api/contact/edit",
            "Id",
            "Danh sách Contact trùng",
            heades,
            model);
    });
</script>
